import java.io.*;
import java.util.Scanner;
import java.util.StringTokenizer;

public class 地毯 {
    //https://www.luogu.com.cn/problem/P3397
    //二维差分的模板题
    public static int[][] arr = new int[1005][1005];//测试数据不会超过这个数组
    public static int n;
    //快读快写, 不然会超时的
    public static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static Read in = new Read();
    public static void main(String[] args) throws IOException{
        n = in.nextInt();
        int m = in.nextInt();
        while(m-- > 0){
            //四个坐标, 然后先一个个填入差分数组里面
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int d = in.nextInt();
            set(a,b,c,d,1);
        }
        //一次搞定
        build();
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                out.print(arr[i][j] + " ");
            }
            out.println();
        }
        out.close();
    }

    private static void build() {
        for (int i = 1; i <= n + 1; i++) {
            for (int j = 1; j <= n + 1; j++) {
                //二维前缀和的第一个加和
                arr[i][j] += arr[i][j - 1] + arr[i - 1][j] - arr[i - 1][j - 1];
            }
        }
    }
    //直接套模板即可
    private static void set(int a, int b, int c, int d, int k) {
        arr[a][b] += k;
        arr[a][d + 1] -= k;
        arr[c + 1][b] -= k;
        arr[c + 1][d + 1] += k;
    }
    public static class Read {
        StringTokenizer st = new StringTokenizer("");
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String next() throws IOException
        {
            while(!st.hasMoreTokens())
            {
                st = new StringTokenizer(bf.readLine());
            }
            return st.nextToken();
        }

        String nextLine() throws IOException
        {
            return bf.readLine();
        }

        int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException
        {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException
        {
            return Double.parseDouble(next());
        }
    }
}

